﻿using System;
using System.Collections.Generic;

namespace HYElectricSetting
{
	public class WireSizeData
	{
		public WireSizeData()
		{
			this.WireType = new WireTypeData();
			this.WireSizes = new Dictionary<double, double>();
		}

		public WireSizeData(WireSizeData other)
		{
			this.WireType = new WireTypeData(other.WireType);
			this.WireSizes = new Dictionary<double, double>();
			foreach (KeyValuePair<double, double> keyValuePair in other.WireSizes)
			{
				this.WireSizes.Add(keyValuePair.Key, keyValuePair.Value);
			}
		}

		public WireTypeData WireType { get; set; }

		public Dictionary<double, double> WireSizes { get; set; }

		public void WireSizeSorted()
		{
			SortedDictionary<double, double> sortedDictionary = new SortedDictionary<double, double>(this.WireSizes);
			this.WireSizes.Clear();
			foreach (KeyValuePair<double, double> keyValuePair in sortedDictionary)
			{
				this.WireSizes.Add(keyValuePair.Key, keyValuePair.Value);
			}
		}

		public override string ToString()
		{
			return this.WireType.Name;
		}
	}
}
